<template>
  <div class="app-container">
    <div v-if="isshow">
      <el-row class="firstRow">
        <el-col>
          <el-button
            type="primary"
            size="small"
            style="float: right"
            plain
            @click="displayAdd"
          >创建考试</el-button>
        </el-col>
      </el-row>
      <examWork />
    </div>
    <addExam v-else @back="back" />
  </div>
</template>

<script>
import examWork from '@/views/exam/exam/components/exam.vue'
import addExam from '@/views/exam/exam/components/addExam.vue'
export default {
  name: 'ContentPage',
  components: {
    addExam,
    examWork
  },
  data() {
    return {
      isshow: true // 控制弹层显示或隐藏
    }
  },
  created() {},
  methods: {
    displayAdd() {
      this.isshow = false
    },
    back() {
      this.isshow = true
    }

  }
}
</script>

<style lang="scss" scoped>
.firstRow {
  padding: 20px 20px 0 0;
  background-color: #fff;
}
.app {
  &-container {
    height: calc(100vh - 50px);
    .dashboard-text {
      display: flex;
      flex-direction: column;
      height: 100%;
    }
  }
}
</style>
